#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
void solve()
{
    ll Time = 0;
    int n = 0;

    cin >> n;
    int i = 0;
    vector<ll> arr(n);
    for (i = 0; i < n; i++)
    {
        cin >> arr[i];
    }
    ll max = arr[n - 1];
    for (i = n - 2; i >= 0; i--)
    {
        if (arr[i] <= max)
        {
            max = arr[i];
        }
        else
        {
            ll times = (arr[i] - 1 + max) / max;
            Time += times - 1;
            max = arr[i] / times;
        }
    }
    cout << Time << endl;
}

int main()
{
    int t = 0;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
